object-safe custom self-types